Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add locale to plant module #970

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

mayank-Pareek
Copy link
Contributor

This PR introduces locale support in the plant module, with enUS set as the default.

Fixes Issue: #898

Changes:

  1. Locale Parameter for Plant Definitions
    • Added getPlantDefinition() with locale as parameter to support locale-based plant data.
    • Defaulted to enUS as a fallback for undefined or unsupported locales:
    const struct PlantDefinition& getPlantDefinition(Locale locale) {
       switch (locale) {
        default:
            return enUSPlantDefinition;
        }
    }
  2. Locale-Specific Naming in Plant Data
    • Updated array naming for plant data, to reflect the locale:
    const auto enUSTrees = std::to_array<std::string_view> {/* data */};
  3. Test Suite Updates
    • Updated plant_test to incorporate the new locale parameter.

  • Ran all unit tests after building project to ensure no breakage from the locale addition.

Copy link
Owner

@cieslarmichal cieslarmichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, just one change requested

include/faker-cxx/plant.h Show resolved Hide resolved
@cieslarmichal cieslarmichal linked an issue Oct 29, 2024 that may be closed by this pull request
@cieslarmichal cieslarmichal merged commit 8dbe13a into cieslarmichal:main Oct 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add locale to plant module
2 participants